package com.tgy.MyFlowable.workflow.controller;

import com.ctsi.core.auth.annotation.PreAuth;
import com.ctsi.core.common.api.Result;
import com.ctsi.workflow.dto.FlwDoneTaskDTO;
import com.ctsi.workflow.service.IFlwDoneTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 已办任务控制器
 *
 * @version 1.0
 * @author: wang xiao xiang
 * @date: 2021/8/8 20:10
 */
@RestController
@AllArgsConstructor
@RequestMapping("/flow/done-task")
@Api(tags = "工作流：已办任务")
public class FlwDoneTaskController {

    private IFlwDoneTaskService flwDoneTaskService;

    @PreAuth
    @GetMapping("/page")
    @ApiOperation(value = "分页")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "current", required = true, value = "当前页", paramType = "form"),
            @ApiImplicitParam(name = "size", required = true, value = "每页显示数据", paramType = "form"),
            @ApiImplicitParam(name = "keyword", required = true, value = "模糊查询关键词", paramType = "form"),
    })
    public Result<?> page(FlwDoneTaskDTO flwDoneTaskDTO) {
        return Result.data(flwDoneTaskService.page(flwDoneTaskDTO));
    }
}
